参考:【python】3.6版本使用http.client网络请求示例
#!/user/bin/python
#-*- coding:utf-8 -*-
import urllib.parse
import http.client
import json
test_data ={'uid':55,'page':1}
test_data_url_encode = urllib.parse.urlencode(test_data)
request_url = "http://m.mp.oeeee.com/uncache.php?m=Doc&a=spaceInfo"
conn = http.client.HTTPConnection('m.mp.oeeee.com')
header = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}
conn.request(method="POST", url=request_url, headers=header, body=test_data_url_encode)
response = conn.getresponse()
#print(response.status)
#print(response.reason)
res = response.read()
#print(res)
resp = json.loads(res)
print(resp)